local Game = {}

Game.__index = Game

local UIManager = require "UI/UIManager"

require "Data/GameData"
--local BenZhen = require "BenZhen/BenZhen"

require "tolua"
require "Util/Class"

function Game:new()
	local object = {}
	setmetatable(object, Game)

	return object
end

function Game:start()
	GameLog.Log("Game Start!")

	-- 通用模块初始化
	self.uiMgr = UIManager:new()

	local canvas = UnityEngine.GameObject.Find("Canvas")
	if(canvas == nil) then
		GameLog.Error("no canvas in the scene")
	else 
		self.uiMgr:registerRoot(canvas)
	end
	--self.BenZhen = BenZhen:new()

	-- 添加update
	UpdateBeat:Add(self.update, self)
end

function Game:destroy()
	self.uiMgr:unRegisterRoot()
end

function Game:update()
	--print("Game Update", self)
end

gameInstance = Game:new() 